package albino.services;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import albino.dao.UserDao;
import albino.domain.Group;
import albino.domain.User;

@Component
public class UserService  {

	@Autowired
	private UserDao userDao;
	
	public User findByUsername(String username) {
		return userDao.getByUsername(username);
	}
	
	@Transactional
	public void installNewUser(User user) {
		userDao.installUser(user);
	}

	@Transactional
	public void installNewGroup(Group group) {
		userDao.installGroup(group);
	}


}
